<%@ include file="/WEB-INF/pages/common/taglibs.jsp" %>
<%@ include file="/WEB-INF/pages/common/checkpermission.jsp" %>

<script type="text/javascript">
    function saveRecord() {
        $("td").removeClass("showErrorClass");
        var currentForm = document.forms["editDeptForm"];
        currentForm.elements["deptModel.deptName"].value = currentForm.elements["deptModel.deptName"].value.trim();
         if (isEmpty(currentForm.elements["deptModel.deptName"].value)) {
            currentForm.elements["deptModel.deptName"].focus();
            $(currentForm.elements["deptModel.deptName"]).parents("tr:first").find("td:first").addClass("showErrorClass");
            alert('<s:text name="label.deptName.required"/>');
            return;
        }
        submitForm("editDeptForm", "save.action");
    }

    function cancelRecord() {
        submitForm("editDeptForm", "search.action");
    }
</script>

<s:form name="editDeptForm" action="">
    <s:hidden name="deptModel.deptId"/>
    <s:hidden name="deptModel.createDt"/>
    <s:hidden name="deptModel.createId"/>
    <table align="center" cellpadding="0" cellspacing="0" class="body_content full_width">
        <tr>
            <td align="left" valign="bottom" class="main_page_content_icon" width="4%">
                <img src='<c:url value="/images/body-icon_check.gif"/>' width="29" height="44">
            </td>
            <td valign="bottom" class="page_title_bg" width="96%"><span class="page_title"><s:text
                    name="label.edit.dept.title"/></span></td>
        </tr>
        <tr>
            <td class="subcontent">&nbsp;</td>
            <td class="subcontent">
                <table class="sectionBorder" width="100%">
                    <tr>
                        <td class="form_label_padded" width="10%" nowrap><s:text name="label.deptName"/></td>
                        <td class="form_label_padded" width="2%">:</td>
                        <td class="txtData" align="left">
                            <s:textfield name="deptModel.deptName" maxlength="25"/>
                        </td>
                    </tr>


                    <tr>
                        <td class="txtData" colspan="3">
                            <input type="button" class="button" value="<s:text name='label.save'/>"
                                   onclick="saveRecord();">
                            <input type="button" class="button" value="<s:text name='label.back'/>"
                                   onclick="cancelRecord();">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</s:form>



